import Vue from 'vue';
import VueRouter from "vue-router";

Vue.use(VueRouter);

const ShopCity = () => import("@/views/shop_city/ShopCity");
const Category = () => import("@/views/category/Category");
const ShopCar = () => import("@/views/shop_car/ShopCar");
const Profile = () => import("@/views/profile/Profile");
const Detail = () => import("@/views/details/Detail");

const routes = [
    {
        path: '/shopCity',
        component: ShopCity
    },
    {
        path: '/category',
        component: Category
    },
    {
        path: '/shopCar',
        component: ShopCar
    },
    {
        path: '/profile',
        component: Profile
    },
    {
        path: '/detail/:iid',
        name: 'detail',
        component: Detail
    },
    {
        path: '*',
        redirect: '/shopCity'
    }
];

const router = new VueRouter({
    routes,
    //mode: "history"
});

export default router;